package com.jqutil.jqutil.cy.entity;
import com.jqutil.jqutil.cy.common.Constant;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.HashMap;
import java.util.List;

/**
 * @Author: chenyun
 * @Date: 2021/09/06/20:41
 * @Description:
 */

// 封装从表格读取数据的对象
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ReadData {
    //星期几
    private String week;
    //节次
    private String courseNum;
    //第一间教室里信息
    private String firstClassroom;
    //第二间教室里信息
    private String secondClassroom;
    //第三间教室里信息
    private String thirdClassroom;
    //第四间教室里信息
    private String fourthClassroom;
    //第五间教室里信息
    private String fifthClassroom;

    private HashMap<String,List<String>> classNameAndListWeek;  // key是教室名字 value是上课的周数


    public void setCourseNum(String courseNum) {
        // 假如传过来1-3 将 第一赋给属性   假如传过来6-8 将第三赋给属性
        if(Constant.COURSENUM_MAP.containsKey(courseNum)){
            this.courseNum = Constant.COURSENUM_MAP.get(courseNum);
        }
    }

    @Override
    public String toString() {
        return "ReadData{" +
                "week='" + week + '\'' +
                ", courseNum='" + courseNum + '\'' +
                ", classNameAndListWeek=" + classNameAndListWeek +
                '}';
    }
}
